<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>Table</title>
    <link rel="stylesheet" href="/static/lib/layuiadmin/plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/static/lib/layuiadmin/css/global.css" media="all">
    <link rel="stylesheet" href="/static/lib/layuiadmin/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/static/lib/layuiadmin/css/table.css" />
</head>

<body>
<div class="admin-main">


    <fieldset class="layui-elem-field">
        <legend>产品列表</legend>
        <div class="layui-field-box layui-form">
            <table class="layui-table admin-table">
                <thead>
                <tr>

                    <th>标题</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="content">
                <{volist name="productList" id="item"}>
                <tr>

                    <td><{$item.name}></td>
                    <td>
                        <a href="javascript:;" data-id="<{$item.id}>" data-opt="add" class="layui-btn layui-btn-danger layui-btn-mini add">加入关联</a>
                    </td>
                </tr>
                <{/volist}>
                </tbody>
            </table>
        </div>
    </fieldset>
    <div><{$productList->render();}></div>

</div>

<script type="text/javascript" src="/static/lib/layuiadmin/plugins/layui/layui.js"></script>
<script>
    layui.config({
        base: '/static/lib/layuiadmin/js/'
    });

    layui.use('layer',function(){
        var layer = layui.layer;
        var $ = layui.jquery;

        $(".add").click(function(){
            var  id = $(this).data('id');
            window.parent.addToAssoc(id);
        });



    });
</script>
</body>

</html>